package com.zhijian.warehouse.manage.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 实验工单枚举类
 *
 * @author HCG
 * @version 1.0
 * @date 2023-11-15
 */
public class WorkOrderEnum {

    /**
     * 表单状态枚举类
     */
    @AllArgsConstructor
    @Getter
    public enum FormStatusEnum {

        WRITING(1, "填写中"),
        REVIEWING(2, "复核中"),
        QA_REVIEWING(3, "QA复核中"),
        END(4, "已完成");

        private Integer code;
        private String desc;

        public static FormStatusEnum getByCode(Integer code) {
            FormStatusEnum[] values = FormStatusEnum.values();
            for (FormStatusEnum anEnum : values) {
                if (anEnum.getCode().equals(code)) {
                    return anEnum;
                }
            }
            return null;
        }
    }

    /**
     * 步骤表单枚举类
     */
    @AllArgsConstructor
    @Getter
    public enum FormStepEnum {

        beforeRecord(1, "beforeRecord", "生产前记录——制粒干燥"),
        accessoriesReceiveRecord(2, "accessoriesReceiveRecord", "物料领取确认记录"),
        produceRecord(3, "produceRecord", "生产记录-制粒干燥"),
        cleanRecord(4, "cleanRecord", "清场记录-制粒干燥"),
        intermediateProductsInRecord(5, "intermediateProductsInRecord", "中间品进站记录"),
        intermediateProductsOutRecord(6, "intermediateProductsOutRecord", "中间品出站记录"),;

        private Integer code;
        private String key;
        private String desc;

        public static FormStepEnum getByCode(Integer code) {
            FormStepEnum[] values = FormStepEnum.values();
            for (FormStepEnum anEnum : values) {
                if (anEnum.getCode().equals(code)) {
                    return anEnum;
                }
            }
            return null;
        }
    }

    /**
     * 状态类
     */
    @AllArgsConstructor
    @Getter
    public enum StatusEnum {

        END(1, "已完成"),
        DOING(0, "进行中"),
        UN_START(-1, "未开始"),;

        private Integer code;
        private String desc;

        public static StatusEnum getByCode(Integer code) {
            StatusEnum[] values = StatusEnum.values();
            for (StatusEnum anEnum : values) {
                if (anEnum.getCode().equals(code)) {
                    return anEnum;
                }
            }
            return null;
        }

    }


}
